package SmartMeeting.builders;

import SmartMeeting.Entity.Meeting;

import java.util.List;

public class ConcreteMeetingBuilder implements MeetingBuilder {
    private final Meeting meeting;

    public ConcreteMeetingBuilder() {
        String id = "MEETING_" + System.currentTimeMillis();
        this.meeting = new Meeting(id);
        System.out.println("创建会议-->" + id);
    }

    @Override
    public void setAgent(String agent) {
        meeting.setAgent(agent);
        System.out.println("设置议程-->" + agent);
    }

    @Override
    public void setTime(String time) {
        meeting.setTime(time);
        System.out.println("设置时间-->" + time);
    }

    @Override
    public void setPlace(String place) {
        meeting.setPlace(place);
        System.out.println("设置地点-->" + place);
    }

    @Override
    public void setParticipants(List<String> participants) {
        meeting.setParticipants(participants);
        System.out.println("设置参会人员-->" + participants);
    }

    @Override
    public Meeting build() {
        System.out.println("会议创建完成" + "\n" + " ");
        return meeting;
    }
}
